<?php

namespace App\Models\Quiz;

class RecordService
{
    protected $repository;

    public function __construct(RecordRepository $repository)
    {
        $this->repository = $repository;
    }

    public function createAndGetId(array $data)
    {
        $record = new QuizRecord();
        $record->fill($data);

        $saved = $this->repository->store($record);

        return $saved->id;
    }
}
